package com.cgsd.heyu.ui.task;

import android.content.Context;
import android.content.Intent;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.cgsd.heyu.R;
import com.cgsd.heyu.common.AvatarManger;
import com.cgsd.heyu.common.UserModeConfig;
import com.cgsd.heyu.presenter.BasePresenter;
import com.cgsd.heyu.ui.BaseActivity;
import com.cgsd.heyu.utils.StatusBarUtil;
import com.google.android.material.imageview.ShapeableImageView;

/**
 * Author: sky on 2021/3/5 10:38
 * Email: xcode126@126.com
 * Desc: 报名任务详情
 */
@Deprecated
public class BookDetailActivity extends BaseActivity<BasePresenter> {

    private TextView tvStatus;
    private TextView tvRemind;
    private ShapeableImageView imageView;
    private TextView tvName;
    private TextView tvCommitTime;
    private TextView tvAmount;
    private TextView tvEdit;
    private ImageView iv_one;
    private ImageView iv_two;
    private ImageView iv_three;
    private EditText etContent;

    public static Intent getIntent(Context context) {
        return new Intent(context, BookDetailActivity.class);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_book_detail;
    }

    @Override
    protected void setStatusBar() {
        StatusBarUtil.fullBar(this);
    }

    @Override
    protected void initView() {
        bindViews();
    }

    @Override
    protected void initData() {
        AvatarManger.setAvatar(this, UserModeConfig.getInstance().headImgUrl, imageView);
        tvName.setText("sky");
        tvStatus.setText("status");
        tvAmount.setText("20");
        tvCommitTime.setText(String.format("%1$s%2$s%3$s", getString(R.string.a_commit_), "1", getString(R.string.a_unit_hour)));
        etContent.setText("产品一刻也不能脱离群众，前提是认清楚谁才是\n" +
                "真正的群众。奔驰的产品思路，是典型的“不需\n" +
                "要讨好社交网络舆论也能卖得好”的一贯路线，\n" +
                "因为它能做出几个让真正的消费者.\n");
        etContent.setEnabled(false);
    }

    /**
     * bind views
     */
    private void bindViews() {
        tvStatus = findViewById(R.id.tv_status);
        tvRemind = findViewById(R.id.tv_remind);
        imageView = findViewById(R.id.iv_bg);
        tvName = findViewById(R.id.tv_name);
        tvCommitTime = findViewById(R.id.tv_commit_time);
        tvAmount = findViewById(R.id.tv_amount);
        tvEdit = findViewById(R.id.tv_edit);
        iv_one = findViewById(R.id.iv_one);
        iv_two = findViewById(R.id.iv_two);
        iv_three = findViewById(R.id.iv_three);
        etContent = findViewById(R.id.et_content);
    }
}
